<!-- orderList.html 2018-09-20 09:09:12-->
#@HplusLayout()
#define cssStyle()
<link href="#(res_path)/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
#end
#define content()
<div style="padding:0 10px;height: 100%">
	<div id="AdvanceSearch" style="padding:15px;display: none">
		<form class="form-horizontal" novalidate="novalidate" onsubmit="return bootstrapTableRefresh()">
						<div class="form-group">
				<label class="col-xs-2 control-label">编号：</label>
				<div class="col-xs-8">
	<input type="text" class="form-control" name="num"/>
				</div>
			</div>
	    			<div class="form-group">
				<label class="col-xs-2 control-label">模块：</label>
				<div class="col-xs-4">
	<input type="text" class="form-control" name="model"/>
				</div>
				<label class="col-xs-2 control-label">名称：</label>
				<div class="col-xs-4">
	<input type="text" class="form-control" name="title"/>
				</div>
			</div>
	    			<div class="form-group">
				<label class="col-xs-2 control-label">支付渠道：</label>
				<div class="col-xs-4">
	<input type="text" class="form-control" name="pay_channel"/>
				</div>
				<label class="col-xs-2 control-label">渠道订单：</label>
				<div class="col-xs-4">
	<input type="text" class="form-control" name="pay_num"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-2 control-label">起始时间：</label>
				<div class="col-xs-4">
					<input type="text" class="form-control" name="start_time" value="#(start_time)"/>
				</div>
				<label class="col-xs-2 control-label">结束时间：</label>
				<div class="col-xs-4">
					<input type="text" class="form-control" name="end_time" value="#(end_time)"/>
				</div>
			</div>
	    			<div class="form-group">
				<div class="col-xs-8 col-xs-offset-3">
					<button type="reset" class="btn btn-default">清空</button> 
					<button type="submit" class="btn btn-primary">开始查询</button> 
				</div>
			</div>
		</form>
	</div>
	<div id="toolbar">
		<button onclick="layer.open({area: ['700px', 'auto'],content:$('#AdvanceSearch'),type:1,shade: false,title:'搜索'});" type="button" class="btn btn-outline btn-default"><i class="glyphicon glyphicon-search"></i></button>
		<button onclick="ajaxTodoByConfirm('changeRepair?type=F','确定暂停支付系统？')" type="button" class="btn btn-outline btn-default">暂停支付系统</button>
		<button onclick="ajaxTodoByConfirm('changeRepair?type=T','确定恢复支付系统？')" type="button" class="btn btn-outline btn-default">恢复支付系统</button>
	</div>
	<table id="bootstrapTable" data-id-field="id" data-url="orderList" data-sort-name="id" data-sort-order="desc">
		<thead>
			<tr>
				<th data-checkbox="true"></th>
				<th data-formatter="xuhaoFormatter" data-align="center" data-width="70px">序号</th>
				<th data-formatter="numFormatter" data-align="center">编号</th>
				<th data-field="model" data-align="center">模块</th>
				<th width="200" data-field="title" data-align="center">名称</th>
				<th data-field="money" data-align="center">金额</th>
				<th data-formatter="status_cnColorFormatter" data-align="center">状态</th>
				<th data-formatter="payFormatter" data-align="center">支付渠道</th>
				<th data-field="pay_result" data-align="center">支付结果</th>
				<th data-field="notify_result" data-align="center">通知结果</th>
			</tr>
		</thead>
	</table>
</div>
#end
#define js()
<script src="#(res_path)/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="#(res_path)/hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

<script src="#(res_path)/hplus/js/plugins/laydate/laydate.js"></script>
#end
#define jsFunction()
<script>
	$(function(){
		laydate.render({elem:"input[name='start_time']",type: "datetime"});
		laydate.render({elem:"input[name='end_time']",type: "datetime"});
	})
	function numFormatter(value,row,index){
		var str = row.num;
		if(row.pay_num){
			str = str+"<br/>"+row.pay_num;
		}
		return str;
	}
	
	function status_cnColorFormatter(value,row,index){
		var str = "";
		if(row.status=="PAID"){
			str = "<span style='color:green'>"+row.status_cn+"</span>";
		}else if(row.status=="READY"){
			str = "<span style='color:red'>"+row.status_cn+"</span>";
		}else {
			str = "<span>"+row.status_cn+"</span>";
		}
		return str;
	}
	function payFormatter(value,row,index){
		return row.pay_channel_cn+"<br/>"+row.pay_time;
	}
</script>
#end